#ifndef _ROBOT_H_
#define _ROBOT_H_

#include <map>
#include <vector>

#include "common.h"

namespace robot {
	struct Action {
		bool stop;		// true to stop immediately

		// Acceleration
		int ax;			// -1 - West, 1 - East
		int ay;			// -1 - North, 1 - South

		bool fire;		// true - fire this turn, false - don't
		int fire_x, fire_y;	// square coordinates to attack
		int fire_damage;	// damage to cause

		Action(): stop(false), ax(0), ay(0), fire(false) {}
	};

	struct Environment {
		int width, height;	// size of the field
		double x, y;		// robot coordinates
		int vx, vy;		// conventional speeds
		int energy, energy_max; // robot's energy and its maximum
		int health;		// robot's health
		int fire_damage_max;	// max damage of his gun
		int turns_before_shot;	// time units till the completion of gun recharging

		// visible terrain squares
		std::map<Point, BasicSquare> terrain;

		// bots' in sight coordinates
		std::vector<BasicPoint<double> > robots;

		// treasures's in sight coordinates
		std::vector<Point> treasures;
	};

	class Robot {
		public:

		virtual Action Move(const Environment&) = 0;
		virtual ~Robot() {}
	};
}

#endif
